package fr.sportcom.sportcom.model;

import android.content.Context;
import android.view.MenuInflater;
import android.view.View;
import android.widget.PopupMenu;

public class OptionMenuPanel  extends PopupMenu {

	private Context mContext;
	private int mMenuRessource;

	public OptionMenuPanel(Context context) {
		super(context, null);
		mContext = context;
	}

	public OptionMenuPanel(Context context, View anchor) {
		super(context, anchor);
		mContext = context;
	}

	public OptionMenuPanel(Context context, View anchor, int res) {
		super(context, anchor);
		mContext = context;
		mMenuRessource = res;
	}

	public void showPopup() {
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(mMenuRessource, getMenu());
		setOnMenuItemClickListener((OnMenuItemClickListener) mContext);
		show();
	}
}
